Implementing Constructor Calls with Parameters in Ada 95

نویسنده

  • Zeki O. Bayram
چکیده

Ada ‘95 does not provide for a constructor mechanism with parameters for initializing newly created objects. The package Ada.Finalization provides an initialize procedure which is automatically called at object creation time, but that procedure takes only one argument, i.e. the object being operated upon. This is hardly useful, since initialization of any kind usually requires additional information, which needs to be supplied through arguments. One way to get around the parameter problem is to specify a tagged type with discriminants that is derived from the limited_controlled type. The parameters that are meant to be given to the initialize procedure are then given as discriminants to the tagged record object. We describe this technique with a concrete example and explore its limitations and implications.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Heterogeneous Data Structures and Cross-Classification of Objects with Ada95

The implementation of ADTs for homogeneous data structures has become a classic example of ADT in Ada 83. With some effort, it was also possible to implement a restricted form of heterogeneous data structures, based on variant records. We show that various approaches in implementing flexible heterogeneous data structures with Ada 95 are now possible. One of these approaches is generalized to cr...

متن کامل

PARIS - Partitioned Ada for Remotely Invoked Services

This paper presents our experience implementing the Ada 95 Annex E to support distributed systems using the GNAT compilerr6]. The work has been performed by a multinational team from France and the USA. The paper describes the implementation of the Partition Communication System and the required support from the GNAT compiler. In addition, extensions beyond Annex E are described that facilitate...

متن کامل

Transaction Support for Ada

This paper describes the transaction support framework OPTIMA and its implementation for Ada 95. First, a transaction model that fits concurrent programming languages is presented. Then the design of the framework is given. Applications from many different domains can benefit from using transactions; it is therefore important to provide means to customize the framework depending on the applicat...

متن کامل

Towards Distributed Objects for Real-Time Systems

This paper illustrates that several of the new features speci$ed in the revised Ada standard facilitate programming real-time distributedparallel applications. In particular; the Ada Distributed Systems Annex supports both statically bound and the more object-oriented dynamically bound remote procedure calls. These features are used to implement a paradigm for composing asynchronous remote proc...

متن کامل

Extending the Object-Orientedness of Ada 95

In the object-oriented extension of Ada 95 some constructs and connected type rules have been introduced that restrict the flexibility in using the whole set of features the object-oriented paradigm provides. Especially the introduction of tagged types leads to a loss of potential reuse if efficiency is of concern while the rules connected with dispatching disable full static type checking for ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • JOOP

دوره 11  شماره 

صفحات  -

تاریخ انتشار 1998